import java.util.Vector;

import javax.swing.AbstractListModel;
/**
 * 
 * @author Administrator
 * clasa in care sunt manipulate datele
 */
class JListData extends AbstractListModel
{
   private Vector data;
//-----------------------------------------
   public JListData()
   {
      data = new Vector();
   }
//-----------------------------------------
   /**
    * functie care returneaza marimea vectorului
    */
   public int getSize()
   {
      return data.size();
   }
//-----------------------------------------
   /**
    * @param index
    * functie care returneaza elementul de pe pozitia index
    */
   public Object getElementAt(int index)
   {
      return data.elementAt(index);
   }
//-----------------------------------------
   /**
    * operatiile de adaugare si stergere din lista
    */
   public void addElement(String s)
   {
      data.addElement(s);
      fireIntervalAdded(this, data.size()-1, data.size());
   }
//-----------------------------------------
   public void removeElement(String s)
   {
      data.removeElement(s);
      fireIntervalRemoved(this, 0, data.size());
   }
}

